Repository navigation
fix(downloader): use Reactor Netty directly so the client needs no Spring WebFlux - #117
Merged
Merged
Conversation
…ring WebFlux TerraformDownloader went through Spring WebClient while spring-boot-starter-webflux was a provided dependency, so plain users of terraform-client failed with NoClassDefFoundError (TK-143). terraform-client now depends on reactor-netty-http (compile scope, version from the Spring Boot parent) instead of the webflux starter, and the downloader uses the Reactor Netty HttpClient directly, writing the body to the file from Netty's buffers. It no longer needs any Spring class. Behaviour is unchanged: same shared client with followRedirect, 32 KiB max header size and proxyWithSystemProperties, so proxy handling (http.* fallback for https, SOCKS, Basic auth on CONNECT) is the same as before. Same headers, per-request response timeout, whole-download caps, partial-file cleanup and release cache. Non-2xx responses fail with the status and URL without touching the target file; interrupts cancel the download and keep the interrupt flag.
|
This was referenced Nov 18, 2026
alfespa17
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
TerraformDownloaderused SpringWebClient, butspring-boot-starter-webfluxis declaredprovidedin terraform-client, so it isn't transitive. Plain users ofterraform-client, and of the starter in an app without WebFlux, fail on the first download withNoClassDefFoundError: org/springframework/http/client/reactive/ClientHttpConnector. Reproduced with this repo'sRawClientLibSampleApp.Change
io.projectreactor.netty:reactor-netty-http(compile scope, version from the Spring Boot parent) instead of the webflux starter.HttpClientdirectly. No Spring class is needed any more.netty-codec-native-quicis excluded (~12 MB of HTTP/3 natives the downloader never uses).netty-codec-http3andnetty-codec-classes-quichave to stay, becauseHttpClientSecurechecksQuic.isAvailable()when it loads.Behaviour unchanged
followRedirect, 32 KiB max header size andproxyWithSystemProperties(). Proxy handling is identical:http.*fallback for https targets,https.*precedence, Basic auth sent on CONNECT, SOCKS.A first attempt with
java.net.httpwas dropped. Its proxy selector ignoreshttp.proxyHostfor https targets, and it refuses Basic proxy auth on CONNECT unless the JVM setsjdk.http.auth.tunneling.disabledSchemes. Both would break authenticated corporate proxies.Tests
TerraformDownloaderTest: idle timeout, whole-download cap with server-side disconnect, binary stall with partial-zip cleanup, interrupt, redirect, 404 message, and three proxy tests against a CONNECT stub (http.* fallback for https, https.* precedence, preemptive Basic auth). The 12 existing tests are unchanged.verify(temurin 17,--init): green.--cpus=1and Netty paranoid leak detection: no leaks.RawClientLibSampleAppwith only its declared runtime classpath now downloads terraform over real https.